package com.example.concurrent.Lock;

import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

/**
 * Created by SOAL on 2017/2/11 0011.
 */
public class LockDemo {

    public static void main(String[] args) {
        Lock lock = new ReentrantLock();

        System.out.println("aaa");
        lock.lock();
        System.out.println("bbb");

        //critical section

        lock.unlock();
        System.out.println("ccc");

    }
}
